<template>
  <div class="search">
    <f-form ref="form" :action="api.aup" :form-key="this.formItem.privatedataId" >
      <f-form-item label="用户id"  name="userId" dataType="${formField.dataType}"   :value="formItem.userId" />
      <f-form-item label="用户姓名"  name="userName" dataType="${formField.dataType}"   :value="formItem.userName" />
      <f-form-item label="证件照"  name="identityImg" dataType="${formField.dataType}"   :value="formItem.identityImg" />
      <f-form-item label="证件类型（1身份证，2护照,3港澳通行证，4台胞证）"  name="identityType" dataType="number"   :value="formItem.identityType" />
      <f-form-item label="证件号码"  name="identityNo" dataType="${formField.dataType}"   :value="formItem.identityNo" />
      <f-form-item label="手机号"  name="mobile" dataType="${formField.dataType}"   :value="formItem.mobile" />
      <f-form-item label="紧急电话"  name="telePhone" dataType="${formField.dataType}"   :value="formItem.telePhone" />
      <f-form-item label="国籍"  name="nationality" dataType="${formField.dataType}"   :value="formItem.nationality" />
      <f-form-item label="签发地"  name="issueAt" dataType="${formField.dataType}"   :value="formItem.issueAt" />
      <f-form-item label="有效期"  name="expiryDate" dataType="${formField.dataType}"   :value="formItem.expiryDate" />
      <f-form-item label="备注"  name="remark" dataType="${formField.dataType}"   :value="formItem.remark" />
      <f-form-item label="性别"  name="sex" dataType="number"   :value="formItem.sex" />
      <f-form-item label="会员年龄"  name="age" dataType="number"   :value="formItem.age" />
      <f-form-item label="出生日期"  name="birthDate" dataType="${formField.dataType}"   :value="formItem.birthDate" />
      <f-form-item label="英文名"  name="firstName" dataType="${formField.dataType}"   :value="formItem.firstName" />
      <f-form-item label="英文姓"  name="lastName" dataType="${formField.dataType}"   :value="formItem.lastName" />
      <f-form-item label="是否本人（1是，2否）"  name="isOneself" dataType="number"   :value="formItem.isOneself" />
      <f-form-item label="初次认证（1是初次认证,2非初次认证）"  name="isFirstAuth" dataType="number"   :value="formItem.isFirstAuth" />
      <f-form-item label="要客卡公司名称"  name="companyName" dataType="${formField.dataType}"   :value="formItem.companyName" />
      <f-form-item label="要客卡不显示在常用旅客里（1展示，2不展示）"  name="companyAddress" dataType="${formField.dataType}"   :value="formItem.companyAddress" />
      <f-form-item label=""  name="isShow" dataType="number"   :value="formItem.isShow" />
      <f-form-item label=""  name="dataType" dataType="number"   :value="formItem.dataType" />
      <f-form-item label="是否删除"  name="deleted" dataType="number"   :value="formItem.deleted" />
      <f-form-item label="更新人"  name="updateUser" dataType="${formField.dataType}"   :value="formItem.updateUser" />
      <f-form-item label="更新时间"  name="updateTime" dataType="${formField.dataType}"   :value="formItem.updateTime" />
      <f-form-item label="创建人"  name="createUser" dataType="${formField.dataType}"   :value="formItem.createUser" />
      <f-form-item label="创建时间"  name="createTime" dataType="${formField.dataType}"   :value="formItem.createTime" />
    </f-form>
  </div>
</template>
<script>
  import api from './js/api'
  export default {
    name: 'aupForm',
    props: {},
    data() {
      return {
        refs:this.$refs,
        api:  Object.assign(api, this.api),
        isAdd: true,//是否是添加模式
        loaded: false,//是否加载完成
        formItem: this.getFormItem()
      }
    },
    methods: {
      getFormItem() {
        return {
          privatedataId: '',
          userId: '',
          userName: '',
          identityImg: '',
          identityType: '',
          identityNo: '',
          mobile: '',
          telePhone: '',
          nationality: '',
          issueAt: '',
          expiryDate: '',
          remark: '',
          sex: '',
          age: '',
          birthDate: '',
          firstName: '',
          lastName: '',
          isOneself: '',
          isFirstAuth: '',
          companyName: '',
          companyAddress: '',
          isShow: '',
          dataType: '',
          deleted: '',
          updateUser: '',
          updateTime: '',
          createUser: '',
          createTime: ''
        }
      },
      //表单赋值
      setData(data) {
        this.$refs.form.resetFields()
        this.formItem = this.getFormItem()
        if (data && data.privatedataId) {
          let params={
              privatedataId:data.privatedataId
          }
          this.refs['form'].getDetails(params,(data)=>{
             this.formItem=data
             this.loaded = true
          })
          this.isAdd = false
        } else {
          this.loaded = true
        }
      },
      //提交表单
      handleSubmit(callback) {
        this.$refs.form.submit({  }, callback)
      }
    },
    created() {
    },
    components: {}
  }
</script>

<style scoped lang="less" rel="stylesheet/less">

</style>
